package lex;

public class Token extends fun.grammar.Word
{
    //    public String tag;
        public int start;
        public int end;
        public String text;
        public int line;
        public int errorCode;
        
        /** default constructor */
        public Token(String tag, int start, int end, String text, int line, int error)
        {
        		super(tag);
        		this.start = start;
                this.end = end;
                this.text = text;
                this.line = line + 1;
                this.errorCode = error;
        }
        
        /** default constructor - no line, no error */
        public Token(String tag, int start, String text)
        {
                this(tag, start, start + text.length(), text, -1, 0);
        }
        
        /** constructor for regular cases - add line */
        public Token(String tag, int start, String text, int line)
        {
                this(tag, start, start + text.length(), text, line, 0);
        }
        
        /** constructor for error case */
        public Token(String tag, int start, String text, int line, int error)
        {
                this(tag, start, start + text.length(), text, line, error);
        }

}